Skip to content

Add Core Web Vitals distribution histogram to tech report#1241

Draft
alonkochba wants to merge 1 commit intoHTTPArchive:mainfrom
alonkochba:feat/dev3-cwv-distribution-histogram
Draft

Add Core Web Vitals distribution histogram to tech report#1241
alonkochba wants to merge 1 commit intoHTTPArchive:mainfrom
alonkochba:feat/dev3-cwv-distribution-histogram

Conversation

@alonkochba
Copy link
Copy Markdown
Member

@alonkochba alonkochba commented Apr 7, 2026

Summary

Adds a "Show distribution" button to the Core Web Vitals timeseries card that reveals a histogram of how origins are distributed across performance buckets. Also refactors the existing "Show table" and "Show geographic breakdown" into a unified button bar for a more compact, power-user-focused UI.

  • Three buttons (Show table, Show geographic breakdown, Show distribution) appear inline below the CWV timeseries chart
  • Only one panel can be open at a time — clicking another button closes the currently open one
  • Histogram supports LCP, CLS, INP, FCP, and TTFB via a metric selector
  • Bars color-coded green/orange/red by good/needs-improvement/poor CWV thresholds
  • Dashed plotlines mark threshold boundaries at bucket boundaries
  • Tail buckets aggregated into an overflow "X+" bar so all origins are visualized
  • Loading spinner while API calls run, error message on failure
  • Supports light and dark mode
  • Anchor links on section headings auto-expand the corresponding panel
  • Both geo breakdown and distribution panels are mobile-responsive (horizontal scroll on overflow)
  • Geo breakdown is now lazy-loaded (only fetches on first open, since the API can be slow)
  • Fetches from /v1/cwv-distribution with technology, date, rank, and geo params

Also scopes the global .highcharts-point CSS rule to line/spline series only, so column chart bar colors render correctly.

Depends on

Test plan

  • Navigate to /reports/techreport/tech?tech=Wix
  • Verify the three buttons appear below the CWV timeseries chart in order: Show table, Show geographic breakdown, Show distribution
  • Click each button — verify only one panel is open at a time (clicking another closes the current)
  • Expand distribution — verify histogram renders with colored bars and threshold lines
  • Switch between LCP, CLS, INP, FCP, TTFB metrics
  • Toggle desktop/mobile client filter
  • Switch to dark mode and verify colors/contrast
  • Verify the overflow "X+" bucket appears at the tail
  • Navigate to #section-cwv_distribution or #section-geo_breakdown — corresponding panel auto-opens
  • Verify existing timeseries charts still render correctly
  • Resize to mobile width — verify both geo breakdown and distribution are scrollable/readable

Closes #1147

@alonkochba alonkochba force-pushed the feat/dev3-cwv-distribution-histogram branch 11 times, most recently from 8d85b23 to 9d68f1b Compare April 13, 2026 17:35
Adds a collapsible histogram chart to the CWV section showing how origins
are distributed across performance buckets for LCP, CLS, INP, FCP, and TTFB.

Features:
- Column chart with bars color-coded green/orange/red by CWV thresholds
- Dashed plotlines marking good/needs-improvement boundaries
- Tail buckets aggregated into an overflow "X+" bar so all origins are shown
- Metric selector in the collapsed summary bar for quick switching
- Loading spinner while the API call is in progress
- Error message when data is unavailable
- Light and dark mode support with theme-aware colors
- Anchor link (#section-cwv_distribution) with auto-expand on direct navigation
- URL hash updates when the section is expanded

Fetches data from /v1/cwv-distribution (HTTPArchive/tech-report-apis#105)
with technology, date, rank, and geo parameters.

Also scopes the global .highcharts-point CSS rule to line/spline series only,
so column chart bar colors are not overridden.

Closes HTTPArchive#1147
@alonkochba alonkochba force-pushed the feat/dev3-cwv-distribution-histogram branch from 9d68f1b to d6cdb0b Compare April 15, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tech Report: Histograms per KPI

1 participant